/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package units;

/**
 *
 * @author jamie
 */
public class DifferentialExpression implements Comparable {

    private MonkeyType monkeyType;
    private int timePoint;
    private double logExp;
    private double pValue;
    private int probeId;
    private CellType ct;



    public DifferentialExpression(int probeId, MonkeyType mt, CellType ct) {
        this.monkeyType = mt;
        this.ct = ct;
        this.probeId = probeId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DifferentialExpression other = (DifferentialExpression) obj;
        if (this.monkeyType != other.monkeyType) {
            return false;
        }
        if (this.timePoint != other.timePoint) {
            return false;
        }
        if (this.probeId != other.probeId) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 83 * hash + this.monkeyType.hashCode();
        hash = 83 * hash + this.timePoint;
        hash = 83 * hash + this.probeId;
        return hash;
    }

    public void setCt(CellType ct) {
        this.ct = ct;
    }

    public CellType getCellType() {
        return ct;
    }

    public double getLogExp() {
        return logExp;
    }

    public void setLogExp(double logExp) {
        this.logExp = logExp;
    }

    public double getpValue() {
        return pValue;
    }

    public void setpValue(double pValue) {
        this.pValue = pValue;
    }

    public MonkeyType getMonkeyType() {
        return monkeyType;
    }

    public void setMonkeyType(MonkeyType monkeyType) {
        this.monkeyType = monkeyType;
    }

    

    public int getTimePoint() {
        return timePoint;
    }

    public void setTimePoint(int timePoint) {
        this.timePoint = timePoint;
    }

    public int compareTo(Object o) {
        DifferentialExpression otherDE = (DifferentialExpression) o;
        if (otherDE.getMonkeyType().equals(otherDE.getMonkeyType())) {
            if (this.getTimePoint() == otherDE.getTimePoint()) {
                return new Integer(this.getProbeId()).compareTo(new Integer(otherDE.getProbeId()));
                
            } else {
                return new Integer(this.getTimePoint()).compareTo(new Integer(otherDE.getTimePoint()));
            }
        } else {
            return this.getMonkeyType().compareTo(otherDE.getMonkeyType());
        }
    }

    public int getProbeId() {
        return probeId;
    }

    public void setProbeId(int probeId) {
        this.probeId = probeId;
    }



}
